package minishell.cmdlet.buildin;


import java.util.List;

import minishell.cmdlet.AbstractCmdlet;
import minishell.object.IObject;
import minishell.object.ListUtilities;

public class ExitCmdlet extends AbstractCmdlet
{
	private static final String NAME = "exit";
	private static final String DESCRIPTION = "Exit MiniShell";
	private static final String USAGE = "exit";
	
	public ExitCmdlet()
	{
	}
	
	public String getName()
	{
		return NAME;
	}

	public String getDescription()
	{
		return DESCRIPTION;
	}

	public String getUsage()
	{
		return USAGE;
	}

	public List<IObject> excute( String arg )
	{
		if( 0 != arg.length() )
			return this.invalidOptionError( arg );
		
		this.getEnvironment().setExit( true );
		return ListUtilities.stringList( "bye~" );
	}
}
